package com.example.zjx8969.myapplication.database;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.example.zjx8969.myapplication.beans.StyleNoListBean;

import java.util.List;

@Dao
public abstract class StyleDao {
    @Query("select * from style where parentId=:id")
    public abstract List<StyleNoListBean> getById(String id);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    public abstract void insertAll(List<StyleNoListBean> listBeans);

    @Query("select * from style ")
    public abstract List<StyleNoListBean> getAll();

    @Query("select * from style where category=:category")
    public abstract List<StyleNoListBean> getAll(String category);

/*    @Query("update style set isNew=1 where id=:id and category=:category and styleNo=:styleNo")
    public abstract void markNew(String id, String category, String styleNo);*/

    @Query("select styleNo from style where category=:category")
    abstract List<String> getCacheIds(String category);
}
